<template>
	<svg class="svg-icon" aria-hidden="true" v-bind="$attrs">
		<use :xlink:href="`#icon-${iconName}`" />
	</svg>
</template>

<script lang="ts">
import { defineComponent } from "vue-demi";

export default defineComponent({
	inheritAttrs: false,
	props: {
		iconName: {
			type: String,
			required: true
		},
		color: {
			type: String,
			default: "currentColor"
		}
	}
});
</script>

<style scoped>
.svg-icon {
	width: 1em;
	height: 1em;
	vertical-align: -0.15em;
	fill: v-bind(color);
	overflow: hidden;
}
</style>
